import { apiPost, apiGetNoheader } from "../utlis/request";



// 注册接口
export function zhu(params) {
    return new Promise((resolve, reject) => {
        apiPost('https://zzgoodqc.cn//index.php/index/index/register', params)
            .then(res => {
                resolve(res)
                // res.data.push(params)
            }).catch(err => {
                reject(err)
            })
    })
}

// 登录接口
export function deng(params) {
    return new Promise((resolve, reject) => {
        apiPost('https://zzgoodqc.cn//index.php/index/index/login', params)
            .then(res => {
                resolve(res)
            }).catch(err => {
                reject(err)
            })
    })
}


// 验证码
export function yanz(params) {
    return new Promise((resolve, reject) => {
        apiGetNoheader('https://zzgoodqc.cn//index.php/index/index/getcode', params)
            .then(res => {
                resolve(res)
            }).catch(err => {
                reject(err)
            })
    })
}

// 数据图表接口
export function tubiao(params) {
    return new Promise((resolve, reject) => {
        apiGetNoheader('https://zzgoodqc.cn//index.php/index/index/getDatas', params)
            .then(res => {
                resolve(res)
            }).catch(err => {
                reject(err)
            })
    })
}

// 订单列表和分页接口
export function dinglist(params) {
    return new Promise((resolve, reject) => {
        apiPost('/index.php/index/Yimi/getOrderList', params)
            .then(res => {
                resolve(res)
            }).catch(err => {
                reject(err)
            })
    })
}

// 订单列表删除接口
export function dingdele(params) {
    return new Promise((resolve, reject) => {
        apiPost('/index.php/index/Yimi/delOrder', params)
            .then(res => {
                resolve(res)
            }).catch(err => {
                reject(err)
            })
    })
}

// 添加订单和编辑订单接口
export function dingtian(params) {
    return new Promise((resolve, reject) => {
        apiPost('/index.php/index/Yimi/addOrder', params)
            .then(res => {
                resolve(res)
            }).catch(err => {
                reject(err)
            })
    })
}

// 订单详情接口
export function dingxiang(params) {
    return new Promise((resolve, reject) => {
        apiPost('/index.php/index/Yimi/getOrderbyid', params)
            .then(res => {
                resolve(res)
            }).catch(err => {
                reject(err)
            })
    })
}
